package com.sz.android;

public class Handler {
    Looper mLooper;
    MessageQueue mMessageQueue;

    public Handler() {
        mLooper = Looper.myLooper();
        mMessageQueue = mLooper.mQueue;
    }

    public Handler(Looper looper) {
        mLooper = looper;
        mMessageQueue = looper.mQueue;
    }

    public void sendMessage(Message message){
        enqueueMessage(message);
    }

    // 网消息队列添加消息
    private void enqueueMessage(Message msg) {
        msg.target = this;
        mMessageQueue.enqueMessage(msg);
    }


    public void handleMessage(Message message) {

    }

    public void dispatchMessage(Message message) {
        handleMessage(message);
    }
}
